package org.spring.bse.home.util;

import org.spring.bse.home.model.Stock;

public class JSONHelper
{

	public static String prepareStockObject(Stock stock)
	{
		StringBuilder strBldr = new StringBuilder();

		strBldr.append("{");
		strBldr.append("\"employees\": [");
		strBldr.append("{");
		strBldr.append("\"scripCode\": \"").append(stock.getScripCode()).append("\" , ");
		strBldr.append("\"scripID\": \"").append(stock.getScripID()).append("\" , ");
		strBldr.append("\"scripName\": \"").append(stock.getScripName()).append("\" , ");
		strBldr.append("\"group\": \"").append(stock.getBseGroup()).append("\" , ");
		strBldr.append("\"index\": \"").append(stock.getIndex()).append("\" , ");
		strBldr.append("\"faceValue\": \"").append(stock.getFaceValue()).append("\" , ");
		strBldr.append("\"industry\": \"").append(stock.getIndustry()).append("\" , ");
		strBldr.append("\"curValue\": \"").append(stock.getCurValue()).append("\" , ");
		strBldr.append("\"chgValue\": \"").append(stock.getChgValue()).append("\" , ");
		strBldr.append("\"chgPer\": \"").append(stock.getChgPer()).append("\" , ");
		strBldr.append("\"updatedAt\": \"").append(stock.getUpdatedAt()).append("\" ");
		strBldr.append("}");
		strBldr.append("]");
		strBldr.append("}");

		return strBldr.toString();
	}
}
